package org.example.springbootdemo.controller;

import org.example.springbootdemo.domain.User;
import org.example.springbootdemo.service.AsyncService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private AsyncService asyncService;
    @GetMapping("/getUser")
    @ResponseBody
    public User getUser(){
        User user = new User(33333L,"123",11,"123");
        asyncService.simpleAsync();
        asyncService.simpleAsync();
        return user;
    }
}
